import time
from selenium import webdriver
from selenium.webdriver.common.by import By

# class EleOperation:
#     def __init__(self):
#         self.driver = webdriver.Chrome()
#         self.driver.get('https://www.baidu.com')
#     def id(self,kw):
#         kw = str(kw)
#         keyw = self.driver.find_element(By.ID,kw)
#         print(keyw.get_attribute('outerHTML'))
#     def class_name(self,class1):
#         keyw = self.driver.find_element(By.CLASS_NAME,class1)
#         print(keyw.get_attribute('outerHTML'))
#     def linke(self,kw):
#         kw = str(kw)
#         keyw = self.driver.find_element(By.LINK_TEXT, kw)
#         print(keyw.get_attribute('outerHTML'))
#     def partlink(self,kw):
#         kw = str(kw)
#         keyw = self.driver.find_element(By.PARTIAL_LINK_TEXT, kw)
#         print(keyw.get_attribute('outerHTML'))
#
#     def name(self,wd):
#         wd = self.driver.find_element(By.NAME,wd)
#         print(wd.get_attribute('outerHTML'))
#     def tag_name(self,wd):
#         wd = self.driver.find_elements(By.TAG_NAME,wd)
#         for i in wd:
#             print(i.get_attribute('outerHTML'))
# case = EleOperation()
# case.id('kw')
# case.tag_name('input')


driver = webdriver.Chrome()
driver.get('https://www.baidu.com')
# id
a = driver.find_element(By.ID,'kw')
# class
b = driver.find_element(By.CLASS_NAME,'s_ipt')
#link_text
c = driver.find_element(By.LINK_TEXT,'新闻')
#partial_link_text
d = driver.find_element(By.PARTIAL_LINK_TEXT,'新')
#name
e = driver.find_element(By.NAME,'rn')
#tag_name
f = driver.find_element(By.TAG_NAME,'input')














